package com.axt.dbaudit.bean.query;

import java.util.List;

import com.axt.dbaudit.base.MsgFuncExt;
import com.axt.dbaudit.base.QueryFilter;
import com.axt.dbaudit.base.QueryType;
import com.axt.dbaudit.model.query.AlarmDetail;
import com.axt.dbaudit.model.query.RealAlarm;

public class QueryRealAlarmBean extends QueryBaseBean{

	public List<RealAlarm> getRealAlarms() {
		try {
			return (List<RealAlarm>)getRecord();
		} catch (Exception e) {
			return null;
		}
	}
	
	public List<AlarmDetail> getAlarmDetail() {
		try {
			return (List<AlarmDetail>)getRecord();
		} catch (Exception e) {
			return null;
		}
	}
	
	/* query real alarms */
	public int queryRealAlarms(String serverPath, List<QueryFilter> filters, int maxRowNum) {
		init();
		setQueryType(QueryType.QUERY_T_REALALARM);
		setMaxRowNum(maxRowNum);
		setFilters(filters);
		
		return query(
				MsgFuncExt.FUNC_QUERY_QUERY_REAL_ALARM, serverPath, 
				"com.axt.dbaudit.model.query.RealAlarm");
	}
	
	/* query real alarms detail */
	public int queryRealAlarmDetail(String serverPath, List<QueryFilter> filters) {
		init();
		setQueryType(QueryType.QUERY_T_ALARM_DETAIL);
		setFilters(filters);
		
		return query(
				MsgFuncExt.FUNC_QUERY_QUERY_NORMAL, serverPath, 
				"com.axt.dbaudit.model.query.AlarmDetail");
	}
}
